package jsyf.oa.entity.system;

import com.alibaba.fastjson.JSONObject;
import jsyf.oa.ientity.BaseEntity;

import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;

@Entity
@Table(name = "T_SYS_LOGS", schema = "oa", catalog = "")
public class LogsEntity extends BaseEntity implements Serializable {

    private String tableSchema;
    private String tableNames;
    private String columnName;
    private String columnNameFormat;
    private String oldValue;
    private String newValue;
    private String updateUserId;
    private String updateId;

    public String getUpdateId() {
        return updateId;
    }

    public void setUpdateId(String updateId) {
        this.updateId = updateId;
    }

    public String getTableSchema() {
        return tableSchema;
    }

    public void setTableSchema(String tableSchema) {
        this.tableSchema = tableSchema;
    }

    public String getTableNames() {
        return tableNames;
    }

    public void setTableNames(String tableNames) {
        this.tableNames = tableNames;
    }

    public String getColumnName() {
        return columnName;
    }

    public void setColumnName(String columnName) {
        this.columnName = columnName;
    }

    public String getColumnNameFormat() {
        return columnNameFormat;
    }

    public void setColumnNameFormat(String columnNameFormat) {
        this.columnNameFormat = columnNameFormat;
    }

    public String getOldValue() {
        return oldValue;
    }

    public void setOldValue(String oldValue) {
        this.oldValue = oldValue;
    }

    public String getNewValue() {
        return newValue;
    }

    public void setNewValue(String newValue) {
        this.newValue = newValue;
    }

    public String getUpdateUserId() {
        return updateUserId;
    }

    public void setUpdateUserId(String updateUserId) {
        this.updateUserId = updateUserId;
    }

    @Override
    public JSONObject getJSONObject() {
        JSONObject json = new JSONObject();
        json.put("TABLE_SCHEMA", getTableSchema());
        json.put("TABLE_NAME", getTableNames());
        json.put("COLUMN_NAME", getColumnName());
        json.put("COLUMN_NAME_FORMAT", getColumnNameFormat());
        json.put("OLD_VALUE", getOldValue());
        json.put("NEW_VALUE", getNewValue());
        json.put("UPDATE_USER_ID", getUpdateUserId());
        json.put("UPDATE_TIME", getUpdateTime());
        json.put("UPDATE_ID", getUpdateId());
        return json;
    }

    @Override
    public String getTableName() {
        return "T_SYS_LOGS";
    }

    @Override
    public JSONObject getJSONColumns() {
        JSONObject json = new JSONObject();
        json.put("TABLE_SCHEMA", "tableSchema");
        json.put("TABLE_NAME", "tableNames");
        json.put("COLUMN_NAME", "columnName");
        json.put("COLUMN_NAME_FORMAT", "columnNameFormat");
        json.put("OLD_VALUE", "oldValue");
        json.put("NEW_VALUE", "newValue");
        json.put("UPDATE_USER_ID", "updateUserId");
        json.put("UPDATE_TIME", "updateTime");
        json.put("UPDATE_ID", "updateId");
        return json;
    }

}
